package com.app.worldcupapp.countdown;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.app.worldcupapp.R;
import com.app.worldcupapp.login.LoginActivity;
import com.squareup.picasso.Picasso;

public class MainActivity extends AppCompatActivity {
TextView mTvMessage;
ImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //找到控件
        mTvMessage=findViewById(R.id.tv_message);
//        imageView = findViewById(R.id.iv_advertisement);


        //倒计时
        new CountDownTimer(5000,1000){

            @Override
            public void onTick(long millisUntilFinished) {
                mTvMessage.setText((millisUntilFinished/1000)+"s");
            }

            @Override
            public void onFinish() {
                Intent intent=new Intent(MainActivity.this, LoginActivity.class);
                startActivity(intent);
//                删除原页面
                finish();
            }
        }.start();

    }


    }

